﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Reflection;

namespace Wangzeran.CodeMaker.Core.Config
{
    /// <summary>
    /// 配置文件工厂
    /// </summary>
    public class ConfigFactory
    {
        /// <summary>
        /// 根节点
        /// </summary>
        private const string RootNode = "codeMaker";
        /// <summary>
        /// 插件节点
        /// </summary>
        private const string PlugInsNode = "plugIns";
        /// <summary>
        /// 插件节点
        /// </summary>
        private const string DataTypeNode = "dataType";
        /// <summary>
        /// 模板文件节点
        /// </summary>
        private const string TemplatesNode = "templates";

        /// <summary>
        /// 初始化配置
        /// </summary>
        public static void InitConfig()
        {
            try
            {
                ConfigurationManager.GetSection(RootNode + "/" + PlugInsNode);
                ConfigurationManager.GetSection(RootNode + "/" + DataTypeNode);
                ConfigurationManager.GetSection(RootNode + "/" + TemplatesNode);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

    }
}
